diff --git a/CMakeLists.txt b/CMakeLists.txt index 504edf4..1c2280d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -######################################################## +####################################################### # cmake file for building CED # @author Jan Engels, Desy IT CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR) @@ -123,12 +123,16 @@ IF( CED_SERVER ) INSTALL( TARGETS glced DESTINATION bin ) + # Install dll in bin directory in the case of CYGWIN + IF( CYGWIN ) + INSTALL( TARGETS CED DESTINATION bin ) + ENDIF() + ENDIF( CED_SERVER ) # ------------------ CED TESTS ------------------ -#FOREACH( _testname test_ced test_ced_mhits test_ced_color ) -FOREACH( _testname test_ced test_ced_mhits ) +FOREACH( _testname test_ced test_ced_mhits test_ced_color ) IF( BUILD_TESTING ) ADD_EXECUTABLE( ${_testname} ./src/tests/${_testname}.cc ) diff --git a/src/client/glut_socks.cc b/src/client/glut_socks.cc index 209ec52..fc57d57 100644 --- a/src/client/glut_socks.cc +++ b/src/client/glut_socks.cc @@ -115,7 +115,11 @@ static void tcp_server_accept(struct __glutSocketList *list){ int fd; tcp_srv_sock *nl; struct sockaddr_in myclient; +#if defined(__CYGWIN__) + socklen_t size=sizeof(myclient); +#else unsigned int size=sizeof(myclient); +#endif ; diff --git a/src/server/ced_srv.cc b/src/server/ced_srv.cc index 60c6516..9114e88 100644 --- a/src/server/ced_srv.cc +++ b/src/server/ced_srv.cc @@ -37,7 +37,9 @@ #define PORT 0x1234 #define PI 3.14159265358979323846f - +#if defined(__CYGWIN__) +#define M_PI 3.14159265358979323846f +#endif //hauke //int graphic[3]; diff --git a/src/server/glced.cc b/src/server/glced.cc index c356b59..d3d109e 100644 --- a/src/server/glced.cc +++ b/src/server/glced.cc @@ -81,6 +81,9 @@ static GLfloat window_width=0.; static GLfloat window_height=0.; #include +#if defined(__CYGWIN__) +#define M_PI 3.14159265358979323846f +#endif #define DEFAULT_WORLD_SIZE 1000. //SJA:FIXED Reduce world size to give better scale diff --git a/src/tests/test_ced.cc b/src/tests/test_ced.cc index 88d3b4c..977dfae 100644 --- a/src/tests/test_ced.cc +++ b/src/tests/test_ced.cc @@ -1,5 +1,9 @@ #include #include +#if defined(__CYGWIN__) +#define M_SQRT2 1.4142135623730950 +#endif +#include double length = 100; @@ -17,7 +21,15 @@ int main(){ /* * Initialisation */ - ced_client_init("localhost",7286); + char *p; + p = getenv("CED_PORT"); + if(p != NULL){ + printf("Try to use user defined port %s.\n", p); + ced_client_init("localhost",atoi(p)); + }else{ + printf("CED_PORT undefined. Using CED_PORT=7286.\n"); + ced_client_init("localhost",7286); + } ced_register_elements(); /* diff --git a/src/tests/test_ced_color.cc b/src/tests/test_ced_color.cc index dd39ceb..2d51672 100644 --- a/src/tests/test_ced_color.cc +++ b/src/tests/test_ced_color.cc @@ -1,6 +1,8 @@ #include #include #include +#include +#include double length = 5; @@ -18,7 +20,16 @@ int main(){ /* * Initialisation */ - ced_client_init("localhost",20131); + char *p; + p = getenv("CED_PORT"); + if(p != NULL){ + printf("Try to use user defined port %s.\n", p); + ced_client_init("localhost",atoi(p)); + }else{ + printf("CED_PORT undefined. Using CED_PORT=7286.\n"); + ced_client_init("localhost",7286); + } + ced_register_elements(); /* diff --git a/src/tests/test_ced_mhits.cc b/src/tests/test_ced_mhits.cc index c2beab0..1cb0076 100644 --- a/src/tests/test_ced_mhits.cc +++ b/src/tests/test_ced_mhits.cc @@ -11,7 +11,15 @@ int main(){ /* * Initialisation */ - ced_client_init("localhost",7286); + char *p; + p = getenv("CED_PORT"); + if(p != NULL){ + printf("Try to use user defined port %s.\n", p); + ced_client_init("localhost",atoi(p)); + }else{ + printf("CED_PORT undefined. Using CED_PORT=7286.\n"); + ced_client_init("localhost",7286); + } ced_register_elements(); time_t t;